package com.example.orderserver.action;


import com.example.orderserver.biz.employeeBiz;
import com.example.orderserver.pojo.employee;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/orderserver")
public class employeeAction {

    @Autowired
    private employeeBiz employeebiz;


    @GetMapping("/list/{id}")
    public employee list(@PathVariable("id") String id){

        employee list = employeebiz.list(id);
        System.out.println(list.toString());
      return list;
    }
    @GetMapping("/selectall")
    public List<employee> selectall(){
        return  employeebiz.selectall();
    }

    @GetMapping("/deleteByid/{id}")
    public void  deleteByid(@PathVariable("id") Integer id){
          employeebiz.deleteByid(id);

    }

}
